package com.n9.start;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 工程启动类<br/>
 * 外部Tomcat服务器部署war包时需要继承自SpringBootServletInitializer
 * @author ice
 * @Version 2018年4月24日
 */

@ComponentScan(basePackages="com.n9")
@EntityScan("**.entity.**")
@EnableJpaRepositories(basePackages= "com.n9.**")
@EnableTransactionManagement
@EnableAspectJAutoProxy(exposeProxy=true)
@EnableScheduling
@SpringBootApplication
public class App extends SpringBootServletInitializer {
	public static void main(String[] args) {
		SpringApplication.run(App.class, args);
	}
	
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return builder.sources(App.class);
	}
	
}
